#include <stdio.h>
/*
 * Write a program to copy its input to its output, 
 * replacing each string of one or more blanks by a single blank.
 */

main()
{
	int result;	
	int car;
	int space;
	
	while((car = getchar()) != EOF){
		result = ((car == '\t') || (car == '\n') || (car == ' '));
		space = result;
		while(result)
			if((car = getchar()) != EOF)
				result = ((car == '\t') || (car == '\n') || (car == ' '));
		if(!space)
			printf("%c", car);
		else
			printf(" %c", car);
	}
}
